package com.alei.redis.redisdemo.controller;

import org.springframework.web.bind.annotation.RestController;
import redis.clients.jedis.Jedis;

import java.util.Set;

/**
 * @author ShiLei
 * @version v1.0
 * @date 2020-06-29 17:51
 */
@RestController
public class RedisZSetDemoController {

    public static void main(String[] args) {
        Jedis jedis = new Jedis("47.95.223.193", 6382);
        for (int i = 0; i < 100; i++) {
            jedis.zadd("zsetKey",i,i+":value");
        }
        Set<String> zsetKey = jedis.zrange("zsetKey", 0, 50);
        System.out.println(zsetKey);
    }
}
